<template>
    <view class="u-m-t-30 uni-shadow u-p-t-10">
        <u-row class="u-flex u-flex-wrap">
            <u-col span="6" v-for="(item,index) in superviseItem" :key="index"
                class="u-m-t-20" style="flex-direction:row">
                <text class="u-m-r-20 u-font-28 uni-gery-color">{{item.title}}</text>
                <text class="u-font-28 u-line-1" style="width:55%" @longtap="longTap(item.value)">{{item.value}}</text>
            </u-col>
        </u-row>

        <!-- 提示组件 -->
        <u-toast ref="uToast"></u-toast>
    </view>
</template>

<script>
export default {
    name: 'superviseItem',
    props:{
        listItem: {
            type: Object,
            default(){
                return {}
            }
        },
    },
    data(){
        return{
            superviseItem: [
                { filed:'xmmc', title:'项目名称', value:'' },
                { filed:'yjlx', title:'预警类型', value:'' },
                { filed:'districtName', title:'所属区划', value:'' },
                { filed:'yjsj', title:'预警时间', value:'' },
                { filed:'jsdw', title:'建设单位', value:'' },
                { filed:'', title:'是否解除', value:'' },
                { filed:'sgdw', title:'施工单位', value:'' },
                { filed:'jcsj', title:'解除时间', value:'' },
                { filed:'dbjg', title:'督办机构', value:'' }
            ]
        }
    },
    created() {
        this.superviseItem.map((v,i)=>{
            if( v.filed ){
                v.value = this.listItem[v.filed]
            }else{
                v.value = '接口未返回该字段'
            }
        })
    },

    methods: {
        // 长按事件
        longTap(value){
            this.$refs.uToast.show({
                message: value,
                type: 'default',
                duration: 3000
            })
        }
    },
}
</script>

<style scoped lang="scss">

</style>